<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./Promise.js"></script>

    <script>
      //实例化 Promise 对象
      let p = new Promise((resolve, reject) => {
        //改变 promise 状态的方式
        resolve('OKOKOKOK');
        reject("Error");
        // throw '出问题啦~~';
        // console.log(123);
      });

      p.then(
        (v) => {
          console.log(v);
        },
        (r) => {
          console.log(r);
        }
      );
    </script>
  </body>
</html>
